package org.spring.aicloud;


import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
//import com.volcengine.ark.runtime.model.completion.chat.ChatCompletionRequest;
//import com.volcengine.ark.runtime.model.completion.chat.ChatMessage;
//import com.volcengine.ark.runtime.model.completion.chat.ChatMessageRole;
//import com.volcengine.ark.runtime.service.ArkService;


import java.util.ArrayList;
import java.util.List;

@SpringBootTest
public class DoubaoTest {

    @Test
    void chat() {
//        String apiKey = "5cdde4c6-25ab-474b-bdbf-12c44087f29a";
//        ArkService service = ArkService.builder()
//                .apiKey(apiKey).baseUrl("https://ark.cn-beijing.volces.com/api/v3/").build();
//
//        final List<ChatMessage> messages = new ArrayList<>();
//        final ChatMessage userMessage = ChatMessage.builder().role(ChatMessageRole.USER)
//                .content("你是谁？").build();
//        messages.add(userMessage);
//
//        ChatCompletionRequest chatCompletionRequest = ChatCompletionRequest.builder()
//                .model("ep-20240713083641-9fwdc")
//                .messages(messages)
//                .build();
//
//        String content = service.createChatCompletion(chatCompletionRequest).getChoices()
//                .get(0).getMessage().getContent().toString();
//        System.out.println(content);


//        Credentials.getCredentials(ak,sk)

    }

}
